import { defineStore } from 'pinia'
import { store } from '/@/store'

interface ActProcessNodeDataState {
  assignee: string | null
  candidateUsers: string | null
  candidateGroups: string | null
}

export const useActProcessNodeDataStore = defineStore({
  id: 'actProcessNodeData',
  state: (): ActProcessNodeDataState => ({
    assignee: null,
    candidateUsers: null,
    candidateGroups: null,
  }),
  getters: {
  },
  actions: {
    setAssignee(value?: string | null): void {
      typeof value === 'undefined' ? this.assignee = null : this.assignee = value
    },
    setCandidateUsers(value?: string | null): void {
      typeof value === 'undefined' ? this.candidateUsers = null : this.candidateUsers = value
    },
    setCandidateGroups(value?: string | null): void {
      typeof value === 'undefined' ? this.candidateGroups = null : this.candidateGroups = value
    },
  },
})

export function useActProcessNodeDataStoreWithout() {
  return useActProcessNodeDataStore(store)
}
